This document provides instructions for building the ofiq_lib.dll native library.
Conan handles all dependency management automatically.
Install Conan:
pip install conan==2.0.17
Build using Python script:
cd scripts
python build_ofiq.py
Alternative: Use batch script:
cd scripts
build.cmd
This method requires downloading external dependencies manually.
Download external dependencies:
extern/ directoryBuild using Python script:
cd scripts
python build_ofiq.py --no-conan
This method attempts to build with whatever dependencies are available. Note that this may not work for all functionality.
Check available dependencies:
cd scripts
python build_ofiq.py --no-conan --no-download --skip-deps
If dependencies are missing, the script will show what's available and what's missing
For minimal builds, you can try with available dependencies only:
cd scripts
python build_ofiq.py --no-conan --no-download --skip-deps
Note: This approach requires that all necessary dependencies are already available in the extern/ directory. If dependencies are missing, the build will fail.
python build_ofiq.py [options]
| Option | Description | Default |
|---|---|---|
--arch x64|x86 |
Target architecture | x64 |
--compiler 16|17 |
Visual Studio version (16=2019, 17=2022) | 16 |
--debug |
Build Debug configuration | Release |
--no-conan |
Build dependencies from source | Use Conan |
--no-download |
Skip downloading external files | Download |
# Default build (x64, Release, VS2019 with Conan)
python build_ofiq.py
# Build 32-bit version
python build_ofiq.py --arch x86
# Use Visual Studio 2022
python build_ofiq.py --compiler 17
# Build Debug configuration
python build_ofiq.py --debug
# Build without Conan (requires external dependencies)
python build_ofiq.py --no-conan
# Build without downloading (requires pre-downloaded dependencies)
python build_ofiq.py --no-conan --no-download
After successful build, you'll find:
ofiq_lib.dll - Main library fileOFIQSampleApp.exe - Sample applicationinstall_x86_64/Release/include/data/models/ (downloaded automatically)Missing Conan:
Error: Missing required tools: conan
Solution: Install Conan: pip install conan==2.0.17
Missing external dependencies:
OpenCV source not found at: ...\extern\opencv-4.5.5
Solution: Download external dependencies or use Conan
CMake not found:
Error: Missing required tools: cmake
Solution: Install CMake 3.26+ from cmake.org
Visual Studio not found:
CMake Error: Could not create named generator Visual Studio 16 2019
Solution: Install Visual Studio 2019 or 2022
conan/ directoryextern/ directorydata/models/ directorybuild/ and install_x86_64/ directoriesAfter build, verify the output:
ofiq_lib.dll in install_x86_64/Debug/bin/ (Debug) or install_x86_64/Release/bin/ (Release)cd "install_x86_64/Debug/bin"
.\OFIQSampleApp.exe -c "../../../data/ofiq_config.jaxn" -i "../../../data/tests/images/b-01-smile.png"
Expected Output: Quality assessment scores for the test image, including UnifiedQualityScore, BackgroundUniformity, IlluminationUniformity, and other metrics.
The built ofiq_lib.dll can be used with the C# wrapper:
ofiq_lib.dll to your C# project output directoryOFIQEngine class from the C# wrapperFor build issues: